package dmqm.mall.mapper;

import dmqm.mall.model.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrderMapper {
    @Select("select * from mall_order")
    List<Order> List();

    @Insert("insert into mall_order(pid,uid,status,create_time,update_time) values (#{pid},#{uid},#{status},#{createTime},#{updateTime})")
    int Add(Order order);

    @Update("update mall_order set pid=#{pid},uid=#{uid},status=#{status},update_time=#{updateTime} where id=#{id}")
    int Update(Order order);

    @Delete("delete * from mall_order where id=#{id}")
    int Delete(@Param("id") int id);

    @Select("select * from mall_order where id=#{id}")
    Order Get(@Param("id") int id);
}
